guint32 timer;
- guint button : 2;
guint child_has_focus : 1;
guint click_child : 3;
guint remove_in_detach : 1;
priv->scrollable = FALSE;
priv->in_child = ARROW_NONE;
priv->click_child = 0;
- priv->button = 0;
priv->need_timer = 0;
priv->child_has_focus = FALSE;
priv->focus_out = FALSE;
priv->group = 0;
- priv->pressed_button = -1;
+ priv->pressed_button = 0;
priv->dnd_timer = 0;
priv->switch_tab_timer = 0;
priv->source_targets = gtk_target_list_new (notebook_targets,
gboolean left = (ARROW_IS_LEFT (arrow) && !is_rtl) ||
(!ARROW_IS_LEFT (arrow) && is_rtl);
+ if (priv->pressed_button)
+ return FALSE;
+
if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
- priv->button = button;
+ priv->pressed_button = button;
priv->click_child = arrow;
if (button == GDK_BUTTON_PRIMARY)
GtkNotebookArrow arrow;
gdouble x, y;
- if (event->type != GDK_BUTTON_PRESS || !priv->children ||
- priv->button)
+ if (event->type != GDK_BUTTON_PRESS || !priv->children)
return FALSE;
if (!get_widget_coordinates (widget, (GdkEvent *)event, &x, &y))
if (event->button != GDK_BUTTON_PRIMARY)
return FALSE;
- priv->button = event->button;
+ priv->pressed_button = event->button;
if ((tab = get_tab_at_pos (notebook, x, y)) != NULL)
{
/* save press to possibly begin a drag */
if (page->reorderable || page->detachable)
{
- priv->pressed_button = event->button;
-
priv->mouse_x = x;
priv->mouse_y = y;
priv->need_timer = FALSE;
}
priv->click_child = 0;
- priv->button = 0;
+ priv->pressed_button = 0;
gtk_notebook_redraw_arrows (notebook);
}
if (!page || !page->tab_label)
return;
- priv->pressed_button = -1;
+ priv->pressed_button = 0;
if (page->reorderable || page->detachable)
{
notebook = GTK_NOTEBOOK (widget);
priv = notebook->priv;
+ if (priv->pressed_button != event->button)
+ return FALSE;
+
if (priv->operation == DRAG_OPERATION_REORDER &&
priv->cur_page &&
- priv->cur_page->reorderable &&
- event->button == priv->pressed_button)
+ priv->cur_page->reorderable)
gtk_notebook_stop_reorder (notebook);
- if (event->button == priv->button)
- {
- stop_scrolling (notebook);
- return TRUE;
- }
- else
- return FALSE;
+ stop_scrolling (notebook);
+ return TRUE;
}
static void
return FALSE;
if (!(event->state & GDK_BUTTON1_MASK) &&
- priv->pressed_button != -1)
+ priv->pressed_button != 0)
{
gtk_notebook_stop_reorder (notebook);
stop_scrolling (notebook);
gtk_notebook_redraw_arrows (notebook);
}
- if (priv->pressed_button == -1)
+ if (priv->pressed_button == 0)
return FALSE;
if (page->detachable &&